1. Field of the Invention
The present invention relates generally to a system and method for facilitating editing of codes such as HTML and XML codes by scripts. More specifically, a system and method for facilitating examining and/or editing of tag-based code such as HTML and XML codes by scripts are disclosed.
2. Description of Related Art
Tag-based software languages such as HTML and XML utilize tags to delineate beginning and end of sections of a piece of code. Examples of begin and end tag pairs in HTML include “<HEAD>” and “</HEAD>,” “<TITLE>” and “<TITLE>,” and “<CENTER>” and “</CENTER>.” Such begin and end tag pairs thus designate the beginning and end of specific sections and/or formatting within the piece of code.
Tag-based files are often utilized for storing and displaying various data such as employee records data. In order to maintain and update such data, records may need to be added, edited, or deleted. Automatic editing of such tag-based files is desired as manually editing such records within the tag-based file can be tedious, time-consuming, and error-prone.
In order to edit or otherwise manipulate such tag-based code, it is desirable to utilize existing scripts or script languages. There are many existing scripts and script languages designed for easy manipulation and editing of codes for various purposes. However, such script languages and script commands are typically line-based. For example, in Unix, the script command “grep” performs a search for a specific phrase or string in a particular file and prints all lines in the file that contain the matching string.
In contrast, tag-based languages are not line-based and an entire piece of code such as an HTML file may be contained within a single line or any suitable number of lines. In other words, any number of beginning and end tags or tag pairs may be contained in any number of suitable lines. As is evident, it would be difficult to utilize script languages that are often line-based to locate beginning and end tags in order to process and edit only the desired data between the beginning and end tags.
Therefore, it is desirable to provide a system and a method to facilitate examining and/or editing of tag-based code using script languages.